﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ProgressPage.aspx.vb" Inherits="WeightLossProject.ProgressPage" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

  <style type="text/css"> 
    .emptypng { background-image: url(images/empty.png); width: 32px; height: 32px; } 
    .smileypng { background-image: url(images/smiley.png); width: 32px; height: 32px; } 
    .donesmileypng { background-image: url(images/smiley-done.png); width: 32px; height: 32px; }
     
    .appleemptypng { background-image: url(images/applebw.png); width: 32px; height: 32px; }
    .applesmileypng { background-image: url(images/apple.png); width: 32px; height: 32px; }
  </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2 class="custom-header">Weight Loss Progress Update!</h2>
    <h3>Current Rating (Average):</h3>
    <asp:Rating ID="rtAverage" runat="server" CurrentRating="0" MaxRating="5" 
        EmptyStarCssClass="appleemptypng" FilledStarCssClass="applesmileypng" 
        StarCssClass="applesmileypng" WaitingStarCssClass="donesmileypng" Enabled="False" 
        ReadOnly="True" HorizontalAlign="Right">
    </asp:Rating>


    <asp:PlaceHolder ID="phLike" runat="server">
    <div style="float:right;">
        <asp:ImageButton ID="imgBtnLike" runat="server" ImageUrl="images/like.png" 
        Width="167px" />
    <asp:Image ID="imgYouLike" runat="server" ImageUrl="images/youlike.png" 
        Width="167px" />
        </div>
    </asp:PlaceHolder>

    <br/>
    <asp:DetailsView ID="dvProgressPage" runat="server" AllowPaging="True" 
        AutoGenerateRows="False" BackColor="White" BorderColor="#CCCCCC" 
        BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="ID" 
        DataSourceID="dsProgressPage" ForeColor="Black" GridLines="Horizontal" 
        Height="50px" Width="600px">
        <EditRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <Fields>
            <asp:BoundField DataField="Title" HeaderText="Title" 
                SortExpression="Title" >
            <ControlStyle Font-Size="X-Large" ForeColor="#CC0000" />
            </asp:BoundField>
            <asp:HyperLinkField DataNavigateUrlFields="UserID" 
                DataNavigateUrlFormatString="ProfilePage.aspx?UID={0}" DataTextField="UserName" 
                HeaderText="Posted By: " />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="Weight" HeaderText="Weight" 
                SortExpression="Weight" />
            <asp:BoundField DataField="EntryDate" HeaderText="Posted On: " 
                SortExpression="EntryDate" />
            <asp:TemplateField HeaderText="Progress Picture">
            <ItemTemplate><img src="<%# Eval("Picture") %>" width="520px"> </ItemTemplate>
            </asp:TemplateField>
        </Fields>
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
    </asp:DetailsView>
    <asp:SqlDataSource ID="dsProgressPage" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [tblProgress] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="PID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <br />

    <br />

    <br />
    <asp:GridView ID="grdComments" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" DataKeyNames="ID"  
        ForeColor="Black" GridLines="Horizontal">
        <Columns>
            <asp:BoundField DataField="AddedBy" HeaderText="AddedBy" 
                SortExpression="AddedBy" />
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:BoundField DataField="Details" HeaderText="Details" 
                SortExpression="Details" />
            <asp:BoundField DataField="DateAdded" HeaderText="DateAdded" 
                SortExpression="DateAdded" />
        </Columns>
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#242121" />
    </asp:GridView>
    <asp:SqlDataSource ID="dsProgressComments" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [tblComments] WHERE ([Progress_FKID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Progress_FKID" QueryStringField="PID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>


   <asp:PlaceHolder ID="phRating" runat="server">
    <div id="divRating" class="commentbox">
      <p><h2 class=custom-header>Rate This Weight Loss Progress Update!</h2></p>

        <p>
       <asp:Rating ID="rtProgress" runat="server" CurrentRating="0" MaxRating="5" EmptyStarCssClass="emptypng" FilledStarCssClass="smileypng" StarCssClass="smileypng" WaitingStarCssClass="donesmileypng">
    </asp:Rating>
    <asp:Button  id="btnSaveRating" runat="server" Text="Rate This Weight Loss Progress Update!"></asp:Button>
        </p>
        
    </div>
    </asp:PlaceHolder>

    <asp:label runat="server" ID="lblRatingResult"></asp:label>



    <asp:PlaceHolder ID="phCommentBox" runat="server">
    <div id="divComment" class="commentbox">
      <p><h2 class=custom-header>Add your Comment Here</h2></p>

    <p>
        <asp:Label ID="Label3" runat="server" CssClass="formlabel" Text="Comment Title"></asp:Label>
        <asp:TextBox ID="txtCTitle" runat="server" Height="29px" Width="187px"></asp:TextBox>
    </p>
    <p>
        <asp:Label ID="Label2" runat="server" CssClass="formlabel" 
            Text="Comment"></asp:Label>
        <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Width="194px" 
            Height="134px"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="btnAddComment" runat="server" Text="Add Comment" />
    </p>
        <p>
            <asp:CheckBoxList ID="cbTags" runat="server" DataSourceID="dsTags" 
                DataTextField="Tag" DataValueField="ID" RepeatDirection="Horizontal">
            </asp:CheckBoxList>
            Add New Tags Here (Separate by Comma): <asp:TextBox ID="txtNewTags" 
                runat="server" Width="345px"></asp:TextBox>
            <asp:SqlDataSource ID="dsTags" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT [ID], [Tag] FROM [tblTags] WHERE ([Tag] &lt;&gt; ?)">
                <SelectParameters>
                    <asp:Parameter DefaultValue="&quot; &quot;" Name="Tag" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
    </p>
        <p>
            <asp:Button ID="btnTagProgress" runat="server" 
                Text="Tag This Progress Update!" />
    </p>
    
    
    </div>
    </asp:PlaceHolder>


    <asp:PlaceHolder ID="phLogintoComment" runat="server" >
    <div id="divLogintoComment" class="commentbox">
    <h3><b>Please <a href="Account/Login.aspx">Login</a> First to Post Comments and Ratings!</b></h3>
    </div>
    </asp:PlaceHolder>



    </asp:Content>

